﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using System.Text;
using System.IO;
using System.Xml;
using System.Data;
using Gift.WebApp;


public partial class cn_member_center_index : BasePage
{
 
    protected string xmlPagePath = "/xml/page.xml";

    // Methods
    protected void Page_Load(object sender, EventArgs e)
    {
        if (HttpContext.Current.Session["user"] == null)
        {
            base.Response.Redirect("/web_login.html?ru=" + HttpContext.Current.Request.Url.PathAndQuery.Replace("aspx", "html"));
        }
    }

    protected StringBuilder TopAdBind()
    {
        StringBuilder builder = new StringBuilder();
        try
        {
            XmlDocument document = new XmlDocument();
            document.Load(base.Server.MapPath(this.xmlPagePath));
            XmlElement element = (XmlElement)document.SelectSingleNode("page_ad/top");
            builder.AppendLine("<div class=\"container\">");
            builder.AppendLine("<a href=\"" + element.GetAttribute("url") + "\">");
            builder.AppendLine("<img src=\"" + element.GetAttribute("src") + "\" alt=\"" + element.GetAttribute("alt") + "\" />");
            builder.AppendLine("</a>");
            builder.AppendLine("</div>");
        }
        catch
        {
        }
        return builder;
    }

}